#include "flVector3.h"

flVector3::flVector3(float _x, float _y, float _z)
{
	x = _x;
	y = _y;
	z = _z;
}
void flVector3::set(float _x, float _y, float _z)
{
	x = _x;
	y = _y;
	z = _z;
}
		
/*
	Overloading operators
*/
bool flVector3::operator==(const flVector3& v)
{
	return (x == v.x) && (y == v.y) && (z == v.z);
}
bool flVector3::operator!=(const flVector3& v)
{
	return (x != v.x) || (y != v.y) || (z != v.z);
}

// Functions with other Vector3
void		flVector3::operator=	(const flVector3& v)
{
	x = v.x;
	y = v.y;
	z = v.z;
}
flVector3	flVector3::operator+	(const flVector3& v) const
{
	return flVector3(x + v.x, y + v.y, z + v.z);
}
flVector3&	flVector3::operator+=	(const flVector3& v)
{
	x += v.x;
	y += v.y;
	z += v.z;
	return *this;
}
flVector3	flVector3::operator-	(const flVector3& v) const
{
	return flVector3(x - v.x, y - v.y, z - v.z);
}
flVector3&	flVector3::operator-=	(const flVector3& v)
{
	x -= v.x;
	y -= v.y;
	z -= v.z;
	return *this;
}
flVector3	flVector3::operator*	(const flVector3& v) const
{
	return flVector3(x * v.x, y * v.y, z * v.z);
}
flVector3&	flVector3::operator*=	(const flVector3& v)
{
	x *= v.x;
	y *= v.y;
	z *= v.z;
	return *this;
}
flVector3	flVector3::operator/	(const flVector3& v) const
{
	return flVector3(x / v.x, y / v.y, z / v.z);
}
flVector3&	flVector3::operator/=	(const flVector3& v)
{
	x /= v.x;
	y /= v.y;
	z /= v.z;
	return *this;
}

// Functions with float
void		flVector3::operator=	(const float f)
{
	x = f;
	y = f;
	z = f;
}
flVector3	flVector3::operator+	(const float f) const
{
	return flVector3(x + f, y + f, z + f);
}
flVector3&	flVector3::operator+=	(const float f)
{
	x += f;
	y += f;
	z += f;
	return *this;
}
flVector3	flVector3::operator-	(const float f) const
{
	return flVector3(x - f, y - f, z - f );
}
flVector3&	flVector3::operator-=	(const float f)
{
	x -= f;
	y -= f;
	z -= f;
	return *this;
}
flVector3	flVector3::operator*	(const float f) const
{
	return flVector3(x * f, y * f, z * f);
}
flVector3&	flVector3::operator*=	(const float f)
{
	x *= f;
	y *= f;
	z *= f;
	return *this;
}
flVector3	flVector3::operator/	(const float f) const
{
	return flVector3(x / f, y / f, z / f);
}
flVector3&	flVector3::operator/=	(const float f)
{
	x /= f;
	y /= f;
	z /= f;
	return *this;
}